//
//  SocketIOTool.h
//  Socket
//
//  Created by 奇艺果 on 2017/12/21.
//  Copyright © 2017年 奇艺果. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import <UIKit/UIKit.h>
@class QYGDeviceStateChangedModel;
@class QYGRoomChangedModel;
@class SocketIOTool;
@protocol SocketIOToolDelegate

//- (void)socketIO:(SocketIOTool *)socket machineStatusChangedWithData:(QYGDeviceStateChangedModel *)data;
//- (void)socketIO:(SocketIOTool *)socket helloChangedWithData:(id)data;
//- (void)socketIO:(SocketIOTool *)socket SpectatorsChangedWithData:(QYGRoomChangedModel *)data;


@end

typedef void (^MachineStatusChangedBlock) (id data);
typedef void (^HelloBlock) (id data);
typedef void (^SpectatorsChangedBlock) (id data);
typedef void (^PlayerQueueBlock) (id data);
@interface SocketIOTool : NSObject

@property (nonatomic, copy) MachineStatusChangedBlock machineStatusChangedBlock;
@property (nonatomic, copy) HelloBlock helloBlock;
@property (nonatomic, copy) SpectatorsChangedBlock spectatorsChangedBlock;
@property (nonatomic, copy) PlayerQueueBlock playerQueueBlock;

@property (nonatomic, strong) NSString *url;

@property (nonatomic, weak) id <SocketIOToolDelegate> delegate;
/**
 *开始连接
 */
- (void)socketConnectWithChannel:(NSArray*)channels completed:(void (^)(BOOL isSuccess))completed;

/**
 *断开链接
 */
- (void)socketDisConnect;
/**
 *围观者状态改变
 */
- (void)spectatorsChangedComplete:(void (^)(QYGRoomChangedModel *roomChangeModel))complete;
/**
 *开始监听游戏进入下一局
 */
- (void)gameNextOnWithChannel:(NSString *)channel Complete:(void (^)(NSString * userid))complete;

/**
 *取消监听游戏进入下一局
 */
- (void)gameNextOffWithChannel:(NSString *)channel;
- (void)machineChanged;

@end



